#pragma once
#include <string>
#include <vector>
#include <memory>
class FuFuType
{
public:
	FuFuType(int type_id);
	int type_id = 0;
	virtual std::string getTypeString() = 0;
	virtual std::shared_ptr<FuFuType> clone() = 0;
};

class FuFuBasicType : public FuFuType
{
private:
	static std::vector<std::string> type_name;
public:
	enum MyEnum
	{
		BOOL,
		I8,
		I32,
		FLOAT,
		DOUBLE,
		STRING
	};
	FuFuBasicType();
	FuFuBasicType(int btype_id);
	int basic_type_id = 0;
	static const int TYPEID = 1;
	std::string getTypeString();
	FuFuType& operator=(FuFuType& rhs);
	std::shared_ptr<FuFuType> clone();

};

class FuFuArray : public FuFuType
{
public:
	int len = 0;
	std::shared_ptr<FuFuType> under_type;
	FuFuArray(int len, std::shared_ptr<FuFuType> under);
	FuFuArray(const FuFuArray& other);
	FuFuType& operator=(FuFuType& rhs);
	std::string getTypeString();
	std::shared_ptr<FuFuType> clone();
	static const int TYPEID = 2;
};
class FuFuPointer : public FuFuArray
{
public:
	static const int TYPEID = 3;
	FuFuPointer(std::shared_ptr<FuFuType> under);
	std::string getTypeString();
	std::shared_ptr<FuFuType> clone();
};